﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DamageCalculate : MonoBehaviour
{
    private void Awake()
    {
        EventCenter.AddListener<GameObject, float>(MyEventType.Damage, Damage);
    }

    private void Damage(GameObject gameObject,float hurt)
    {
        gameObject.GetComponent<CharacterBase>().health -= hurt;
        Debug.Log("对" + gameObject + "造成了" + hurt + "点伤害");
    }
}
